<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>伪类选择器</title>
		<style>
			.chessboard{
				width: 400px;
				background-color: burlywood;
				border: 10px solid darkgray;
			}
			.chessboard div{
				display: flex;
			}
			.chessboard div span{
				width: 100px;
				height: 100px;
			}
			.chessboard div:nth-child(odd) span:nth-child(even),
			div:nth-child(even) span:nth-child(odd){
				background-color: rgba(0,0,0,0.3);
			}
		</style>
	</head>
	<body>
		<figure class="chessboard">
			<div>
				<span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
			<div>
				<span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
			<div>
				<span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
			<div>
				<span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
		</figure>
	</body>
</html>
